<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - /usr/include/c++/4.3.2/ostream</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.3.2</a> - ostream</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">29</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // Output streams -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
<span class="lineNum">       4 </span>                : // 2006, 2007, 2008
<span class="lineNum">       5 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       6 </span>                : //
<span class="lineNum">       7 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       8 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       9 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">      10 </span>                : // Free Software Foundation; either version 2, or (at your option)
<span class="lineNum">      11 </span>                : // any later version.
<span class="lineNum">      12 </span>                : 
<span class="lineNum">      13 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      14 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      15 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      16 </span>                : // GNU General Public License for more details.
<span class="lineNum">      17 </span>                : 
<span class="lineNum">      18 </span>                : // You should have received a copy of the GNU General Public License
<span class="lineNum">      19 </span>                : // along with this library; see the file COPYING.  If not, write to
<span class="lineNum">      20 </span>                : // the Free Software Foundation, 51 Franklin Street, Fifth Floor,
<span class="lineNum">      21 </span>                : // Boston, MA 02110-1301, USA.
<span class="lineNum">      22 </span>                : 
<span class="lineNum">      23 </span>                : // As a special exception, you may use this file as part of a free software
<span class="lineNum">      24 </span>                : // library without restriction.  Specifically, if other files instantiate
<span class="lineNum">      25 </span>                : // templates or use macros or inline functions from this file, or you compile
<span class="lineNum">      26 </span>                : // this file and link it with other files to produce an executable, this
<span class="lineNum">      27 </span>                : // file does not by itself cause the resulting executable to be covered by
<span class="lineNum">      28 </span>                : // the GNU General Public License.  This exception does not however
<span class="lineNum">      29 </span>                : // invalidate any other reasons why the executable file might be covered by
<span class="lineNum">      30 </span>                : // the GNU General Public License.
<span class="lineNum">      31 </span>                : 
<span class="lineNum">      32 </span>                : /** @file ostream
<span class="lineNum">      33 </span>                :  *  This is a Standard C++ Library header.
<span class="lineNum">      34 </span>                :  */
<span class="lineNum">      35 </span>                : 
<span class="lineNum">      36 </span>                : //
<span class="lineNum">      37 </span>                : // ISO C++ 14882: 27.6.2  Output streams
<span class="lineNum">      38 </span>                : //
<span class="lineNum">      39 </span>                : 
<span class="lineNum">      40 </span>                : #ifndef _GLIBCXX_OSTREAM
<span class="lineNum">      41 </span>                : #define _GLIBCXX_OSTREAM 1
<span class="lineNum">      42 </span>                : 
<span class="lineNum">      43 </span>                : #pragma GCC system_header
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : #include &lt;ios&gt;
<span class="lineNum">      46 </span>                : #include &lt;bits/ostream_insert.h&gt;
<span class="lineNum">      47 </span>                : 
<span class="lineNum">      48 </span>                : _GLIBCXX_BEGIN_NAMESPACE(std)
<span class="lineNum">      49 </span>                : 
<span class="lineNum">      50 </span>                :   // [27.6.2.1] Template class basic_ostream
<span class="lineNum">      51 </span>                :   /**
<span class="lineNum">      52 </span>                :    *  @brief  Controlling output.
<span class="lineNum">      53 </span>                :    *
<span class="lineNum">      54 </span>                :    *  This is the base class for all output streams.  It provides text
<span class="lineNum">      55 </span>                :    *  formatting of all builtin types, and communicates with any class
<span class="lineNum">      56 </span>                :    *  derived from basic_streambuf to do the actual output.
<span class="lineNum">      57 </span>                :   */
<span class="lineNum">      58 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">      59 </span>                :     class basic_ostream : virtual public basic_ios&lt;_CharT, _Traits&gt;
<span class="lineNum">      60 </span>                :     {
<span class="lineNum">      61 </span>                :     public:
<span class="lineNum">      62 </span>                :       // Types (inherited from basic_ios (27.4.4)):
<span class="lineNum">      63 </span>                :       typedef _CharT                                    char_type;
<span class="lineNum">      64 </span>                :       typedef typename _Traits::int_type                int_type;
<span class="lineNum">      65 </span>                :       typedef typename _Traits::pos_type                pos_type;
<span class="lineNum">      66 </span>                :       typedef typename _Traits::off_type                off_type;
<span class="lineNum">      67 </span>                :       typedef _Traits                                   traits_type;
<span class="lineNum">      68 </span>                :       
<span class="lineNum">      69 </span>                :       // Non-standard Types:
<span class="lineNum">      70 </span>                :       typedef basic_streambuf&lt;_CharT, _Traits&gt;            __streambuf_type;
<span class="lineNum">      71 </span>                :       typedef basic_ios&lt;_CharT, _Traits&gt;          __ios_type;
<span class="lineNum">      72 </span>                :       typedef basic_ostream&lt;_CharT, _Traits&gt;              __ostream_type;
<span class="lineNum">      73 </span>                :       typedef num_put&lt;_CharT, ostreambuf_iterator&lt;_CharT, _Traits&gt; &gt;        
<span class="lineNum">      74 </span>                :                                                         __num_put_type;
<span class="lineNum">      75 </span>                :       typedef ctype&lt;_CharT&gt;                               __ctype_type;
<span class="lineNum">      76 </span>                : 
<span class="lineNum">      77 </span>                :       // [27.6.2.2] constructor/destructor
<span class="lineNum">      78 </span>                :       /**
<span class="lineNum">      79 </span>                :        *  @brief  Base constructor.
<span class="lineNum">      80 </span>                :        *
<span class="lineNum">      81 </span>                :        *  This ctor is almost never called by the user directly, rather from
<span class="lineNum">      82 </span>                :        *  derived classes' initialization lists, which pass a pointer to
<span class="lineNum">      83 </span>                :        *  their own stream buffer.
<span class="lineNum">      84 </span>                :       */
<span class="lineNum">      85 </span>                :       explicit 
<span class="lineNum">      86 </span>                :       basic_ostream(__streambuf_type* __sb)
<span class="lineNum">      87 </span>                :       { this-&gt;init(__sb); }
<span class="lineNum">      88 </span>                : 
<span class="lineNum">      89 </span>                :       /**
<span class="lineNum">      90 </span>                :        *  @brief  Base destructor.
<span class="lineNum">      91 </span>                :        *
<span class="lineNum">      92 </span>                :        *  This does very little apart from providing a virtual base dtor.
<span class="lineNum">      93 </span>                :       */
<span class="lineNum">      94 </span>                :       virtual 
<span class="lineNum">      95 </span><span class="lineNoCov">              0 :       ~basic_ostream() { }</span>
<span class="lineNum">      96 </span>                : 
<span class="lineNum">      97 </span>                :       // [27.6.2.3] prefix/suffix
<span class="lineNum">      98 </span>                :       class sentry;
<span class="lineNum">      99 </span>                :       friend class sentry;
<span class="lineNum">     100 </span>                :       
<span class="lineNum">     101 </span>                :       // [27.6.2.5] formatted output
<span class="lineNum">     102 </span>                :       // [27.6.2.5.3]  basic_ostream::operator&lt;&lt;
<span class="lineNum">     103 </span>                :       //@{
<span class="lineNum">     104 </span>                :       /**
<span class="lineNum">     105 </span>                :        *  @brief  Interface for manipulators.
<span class="lineNum">     106 </span>                :        *
<span class="lineNum">     107 </span>                :        *  Manipulators such as @c std::endl and @c std::hex use these
<span class="lineNum">     108 </span>                :        *  functions in constructs like &quot;std::cout &lt;&lt; std::endl&quot;.  For more
<span class="lineNum">     109 </span>                :        *  information, see the iomanip header.
<span class="lineNum">     110 </span>                :       */
<span class="lineNum">     111 </span>                :       __ostream_type&amp;
<span class="lineNum">     112 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(__ostream_type&amp; (*__pf)(__ostream_type&amp;))</span>
<span class="lineNum">     113 </span>                :       {
<span class="lineNum">     114 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     115 </span>                :         // DR 60. What is a formatted input function?
<span class="lineNum">     116 </span>                :         // The inserters for manipulators are *not* formatted output functions.
<span class="lineNum">     117 </span><span class="lineNoCov">              0 :         return __pf(*this);</span>
<span class="lineNum">     118 </span>                :       }
<span class="lineNum">     119 </span>                : 
<span class="lineNum">     120 </span>                :       __ostream_type&amp;
<span class="lineNum">     121 </span>                :       operator&lt;&lt;(__ios_type&amp; (*__pf)(__ios_type&amp;))
<span class="lineNum">     122 </span>                :       {
<span class="lineNum">     123 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     124 </span>                :         // DR 60. What is a formatted input function?
<span class="lineNum">     125 </span>                :         // The inserters for manipulators are *not* formatted output functions.
<span class="lineNum">     126 </span>                :         __pf(*this);
<span class="lineNum">     127 </span>                :         return *this;
<span class="lineNum">     128 </span>                :       }
<span class="lineNum">     129 </span>                : 
<span class="lineNum">     130 </span>                :       __ostream_type&amp;
<span class="lineNum">     131 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(ios_base&amp; (*__pf) (ios_base&amp;))</span>
<span class="lineNum">     132 </span>                :       {
<span class="lineNum">     133 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     134 </span>                :         // DR 60. What is a formatted input function?
<span class="lineNum">     135 </span>                :         // The inserters for manipulators are *not* formatted output functions.
<span class="lineNum">     136 </span><span class="lineNoCov">              0 :         __pf(*this);</span>
<span class="lineNum">     137 </span><span class="lineNoCov">              0 :         return *this;</span>
<span class="lineNum">     138 </span>                :       }
<span class="lineNum">     139 </span>                :       //@}
<span class="lineNum">     140 </span>                : 
<span class="lineNum">     141 </span>                :       // [27.6.2.5.2] arithmetic inserters
<span class="lineNum">     142 </span>                :       /**
<span class="lineNum">     143 </span>                :        *  @name Arithmetic Inserters
<span class="lineNum">     144 </span>                :        *
<span class="lineNum">     145 </span>                :        *  All the @c operator&lt;&lt; functions (aka &lt;em&gt;formatted output
<span class="lineNum">     146 </span>                :        *  functions&lt;/em&gt;) have some common behavior.  Each starts by
<span class="lineNum">     147 </span>                :        *  constructing a temporary object of type std::basic_ostream::sentry.
<span class="lineNum">     148 </span>                :        *  This can have several effects, concluding with the setting of a
<span class="lineNum">     149 </span>                :        *  status flag; see the sentry documentation for more.
<span class="lineNum">     150 </span>                :        *
<span class="lineNum">     151 </span>                :        *  If the sentry status is good, the function tries to generate
<span class="lineNum">     152 </span>                :        *  whatever data is appropriate for the type of the argument.
<span class="lineNum">     153 </span>                :        *
<span class="lineNum">     154 </span>                :        *  If an exception is thrown during insertion, ios_base::badbit
<span class="lineNum">     155 </span>                :        *  will be turned on in the stream's error state without causing an
<span class="lineNum">     156 </span>                :        *  ios_base::failure to be thrown.  The original exception will then
<span class="lineNum">     157 </span>                :        *  be rethrown.
<span class="lineNum">     158 </span>                :       */
<span class="lineNum">     159 </span>                :       //@{
<span class="lineNum">     160 </span>                :       /**
<span class="lineNum">     161 </span>                :        *  @brief  Basic arithmetic inserters
<span class="lineNum">     162 </span>                :        *  @param  A variable of builtin type.
<span class="lineNum">     163 </span>                :        *  @return  @c *this if successful
<span class="lineNum">     164 </span>                :        *
<span class="lineNum">     165 </span>                :        *  These functions use the stream's current locale (specifically, the
<span class="lineNum">     166 </span>                :        *  @c num_get facet) to perform numeric formatting.
<span class="lineNum">     167 </span>                :       */
<span class="lineNum">     168 </span>                :       __ostream_type&amp; 
<span class="lineNum">     169 </span>                :       operator&lt;&lt;(long __n)
<span class="lineNum">     170 </span>                :       { return _M_insert(__n); }
<span class="lineNum">     171 </span>                :       
<span class="lineNum">     172 </span>                :       __ostream_type&amp; 
<span class="lineNum">     173 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(unsigned long __n)</span>
<span class="lineNum">     174 </span><span class="lineNoCov">              0 :       { return _M_insert(__n); }        </span>
<span class="lineNum">     175 </span>                : 
<span class="lineNum">     176 </span>                :       __ostream_type&amp; 
<span class="lineNum">     177 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(bool __n)</span>
<span class="lineNum">     178 </span><span class="lineNoCov">              0 :       { return _M_insert(__n); }</span>
<span class="lineNum">     179 </span>                : 
<span class="lineNum">     180 </span>                :       __ostream_type&amp; 
<span class="lineNum">     181 </span>                :       operator&lt;&lt;(short __n);
<span class="lineNum">     182 </span>                : 
<span class="lineNum">     183 </span>                :       __ostream_type&amp; 
<span class="lineNum">     184 </span>                :       operator&lt;&lt;(unsigned short __n)
<span class="lineNum">     185 </span>                :       {
<span class="lineNum">     186 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     187 </span>                :         // 117. basic_ostream uses nonexistent num_put member functions.
<span class="lineNum">     188 </span>                :         return _M_insert(static_cast&lt;unsigned long&gt;(__n));
<span class="lineNum">     189 </span>                :       }
<span class="lineNum">     190 </span>                : 
<span class="lineNum">     191 </span>                :       __ostream_type&amp; 
<span class="lineNum">     192 </span>                :       operator&lt;&lt;(int __n);
<span class="lineNum">     193 </span>                : 
<span class="lineNum">     194 </span>                :       __ostream_type&amp; 
<span class="lineNum">     195 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(unsigned int __n)</span>
<span class="lineNum">     196 </span>                :       {
<span class="lineNum">     197 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     198 </span>                :         // 117. basic_ostream uses nonexistent num_put member functions.
<span class="lineNum">     199 </span><span class="lineNoCov">              0 :         return _M_insert(static_cast&lt;unsigned long&gt;(__n));</span>
<span class="lineNum">     200 </span>                :       }
<span class="lineNum">     201 </span>                : 
<span class="lineNum">     202 </span>                : #ifdef _GLIBCXX_USE_LONG_LONG
<span class="lineNum">     203 </span>                :       __ostream_type&amp; 
<span class="lineNum">     204 </span>                :       operator&lt;&lt;(long long __n)
<span class="lineNum">     205 </span>                :       { return _M_insert(__n); }
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span>                :       __ostream_type&amp; 
<span class="lineNum">     208 </span>                :       operator&lt;&lt;(unsigned long long __n)
<span class="lineNum">     209 </span>                :       { return _M_insert(__n); }        
<span class="lineNum">     210 </span>                : #endif
<span class="lineNum">     211 </span>                : 
<span class="lineNum">     212 </span>                :       __ostream_type&amp; 
<span class="lineNum">     213 </span>                :       operator&lt;&lt;(double __f)
<span class="lineNum">     214 </span>                :       { return _M_insert(__f); }
<span class="lineNum">     215 </span>                : 
<span class="lineNum">     216 </span>                :       __ostream_type&amp; 
<span class="lineNum">     217 </span>                :       operator&lt;&lt;(float __f)
<span class="lineNum">     218 </span>                :       {
<span class="lineNum">     219 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     220 </span>                :         // 117. basic_ostream uses nonexistent num_put member functions.
<span class="lineNum">     221 </span>                :         return _M_insert(static_cast&lt;double&gt;(__f));
<span class="lineNum">     222 </span>                :       }
<span class="lineNum">     223 </span>                : 
<span class="lineNum">     224 </span>                :       __ostream_type&amp; 
<span class="lineNum">     225 </span>                :       operator&lt;&lt;(long double __f)
<span class="lineNum">     226 </span>                :       { return _M_insert(__f); }
<span class="lineNum">     227 </span>                : 
<span class="lineNum">     228 </span>                :       __ostream_type&amp; 
<span class="lineNum">     229 </span><span class="lineNoCov">              0 :       operator&lt;&lt;(const void* __p)</span>
<span class="lineNum">     230 </span><span class="lineNoCov">              0 :       { return _M_insert(__p); }</span>
<span class="lineNum">     231 </span>                : 
<span class="lineNum">     232 </span>                :       /**
<span class="lineNum">     233 </span>                :        *  @brief  Extracting from another streambuf.
<span class="lineNum">     234 </span>                :        *  @param  sb  A pointer to a streambuf
<span class="lineNum">     235 </span>                :        *
<span class="lineNum">     236 </span>                :        *  This function behaves like one of the basic arithmetic extractors,
<span class="lineNum">     237 </span>                :        *  in that it also constructs a sentry object and has the same error
<span class="lineNum">     238 </span>                :        *  handling behavior.
<span class="lineNum">     239 </span>                :        *
<span class="lineNum">     240 </span>                :        *  If @a sb is NULL, the stream will set failbit in its error state.
<span class="lineNum">     241 </span>                :        *
<span class="lineNum">     242 </span>                :        *  Characters are extracted from @a sb and inserted into @c *this
<span class="lineNum">     243 </span>                :        *  until one of the following occurs:
<span class="lineNum">     244 </span>                :        *
<span class="lineNum">     245 </span>                :        *  - the input stream reaches end-of-file,
<span class="lineNum">     246 </span>                :        *  - insertion into the output sequence fails (in this case, the
<span class="lineNum">     247 </span>                :        *    character that would have been inserted is not extracted), or
<span class="lineNum">     248 </span>                :        *  - an exception occurs while getting a character from @a sb, which
<span class="lineNum">     249 </span>                :        *    sets failbit in the error state
<span class="lineNum">     250 </span>                :        *
<span class="lineNum">     251 </span>                :        *  If the function inserts no characters, failbit is set.
<span class="lineNum">     252 </span>                :       */
<span class="lineNum">     253 </span>                :       __ostream_type&amp; 
<span class="lineNum">     254 </span>                :       operator&lt;&lt;(__streambuf_type* __sb);
<span class="lineNum">     255 </span>                :       //@}
<span class="lineNum">     256 </span>                : 
<span class="lineNum">     257 </span>                :       // [27.6.2.6] unformatted output functions
<span class="lineNum">     258 </span>                :       /**
<span class="lineNum">     259 </span>                :        *  @name Unformatted Output Functions
<span class="lineNum">     260 </span>                :        *
<span class="lineNum">     261 </span>                :        *  All the unformatted output functions have some common behavior.
<span class="lineNum">     262 </span>                :        *  Each starts by constructing a temporary object of type
<span class="lineNum">     263 </span>                :        *  std::basic_ostream::sentry.  This has several effects, concluding
<span class="lineNum">     264 </span>                :        *  with the setting of a status flag; see the sentry documentation
<span class="lineNum">     265 </span>                :        *  for more.
<span class="lineNum">     266 </span>                :        *
<span class="lineNum">     267 </span>                :        *  If the sentry status is good, the function tries to generate
<span class="lineNum">     268 </span>                :        *  whatever data is appropriate for the type of the argument.
<span class="lineNum">     269 </span>                :        *
<span class="lineNum">     270 </span>                :        *  If an exception is thrown during insertion, ios_base::badbit
<span class="lineNum">     271 </span>                :        *  will be turned on in the stream's error state.  If badbit is on in
<span class="lineNum">     272 </span>                :        *  the stream's exceptions mask, the exception will be rethrown
<span class="lineNum">     273 </span>                :        *  without completing its actions.
<span class="lineNum">     274 </span>                :       */
<span class="lineNum">     275 </span>                :       //@{
<span class="lineNum">     276 </span>                :       /**
<span class="lineNum">     277 </span>                :        *  @brief  Simple insertion.
<span class="lineNum">     278 </span>                :        *  @param  c  The character to insert.
<span class="lineNum">     279 </span>                :        *  @return  *this
<span class="lineNum">     280 </span>                :        *
<span class="lineNum">     281 </span>                :        *  Tries to insert @a c.
<span class="lineNum">     282 </span>                :        *
<span class="lineNum">     283 </span>                :        *  @note  This function is not overloaded on signed char and
<span class="lineNum">     284 </span>                :        *         unsigned char.
<span class="lineNum">     285 </span>                :       */
<span class="lineNum">     286 </span>                :       __ostream_type&amp; 
<span class="lineNum">     287 </span>                :       put(char_type __c);
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                :       // Core write functionality, without sentry.
<span class="lineNum">     290 </span>                :       void
<span class="lineNum">     291 </span>                :       _M_write(const char_type* __s, streamsize __n)
<span class="lineNum">     292 </span>                :       {
<span class="lineNum">     293 </span>                :         const streamsize __put = this-&gt;rdbuf()-&gt;sputn(__s, __n);
<span class="lineNum">     294 </span>                :         if (__put != __n)
<span class="lineNum">     295 </span>                :           this-&gt;setstate(ios_base::badbit);
<span class="lineNum">     296 </span>                :       }
<span class="lineNum">     297 </span>                : 
<span class="lineNum">     298 </span>                :       /**
<span class="lineNum">     299 </span>                :        *  @brief  Character string insertion.
<span class="lineNum">     300 </span>                :        *  @param  s  The array to insert.
<span class="lineNum">     301 </span>                :        *  @param  n  Maximum number of characters to insert.
<span class="lineNum">     302 </span>                :        *  @return  *this
<span class="lineNum">     303 </span>                :        *
<span class="lineNum">     304 </span>                :        *  Characters are copied from @a s and inserted into the stream until
<span class="lineNum">     305 </span>                :        *  one of the following happens:
<span class="lineNum">     306 </span>                :        *
<span class="lineNum">     307 </span>                :        *  - @a n characters are inserted
<span class="lineNum">     308 </span>                :        *  - inserting into the output sequence fails (in this case, badbit
<span class="lineNum">     309 </span>                :        *    will be set in the stream's error state)
<span class="lineNum">     310 </span>                :        *
<span class="lineNum">     311 </span>                :        *  @note  This function is not overloaded on signed char and
<span class="lineNum">     312 </span>                :        *         unsigned char.
<span class="lineNum">     313 </span>                :       */
<span class="lineNum">     314 </span>                :       __ostream_type&amp; 
<span class="lineNum">     315 </span>                :       write(const char_type* __s, streamsize __n);
<span class="lineNum">     316 </span>                :       //@}
<span class="lineNum">     317 </span>                : 
<span class="lineNum">     318 </span>                :       /**
<span class="lineNum">     319 </span>                :        *  @brief  Synchronizing the stream buffer.
<span class="lineNum">     320 </span>                :        *  @return  *this
<span class="lineNum">     321 </span>                :        *
<span class="lineNum">     322 </span>                :        *  If @c rdbuf() is a null pointer, changes nothing.
<span class="lineNum">     323 </span>                :        *
<span class="lineNum">     324 </span>                :        *  Otherwise, calls @c rdbuf()-&gt;pubsync(), and if that returns -1,
<span class="lineNum">     325 </span>                :        *  sets badbit.
<span class="lineNum">     326 </span>                :       */
<span class="lineNum">     327 </span>                :       __ostream_type&amp; 
<span class="lineNum">     328 </span>                :       flush();
<span class="lineNum">     329 </span>                : 
<span class="lineNum">     330 </span>                :       // [27.6.2.4] seek members
<span class="lineNum">     331 </span>                :       /**
<span class="lineNum">     332 </span>                :        *  @brief  Getting the current write position.
<span class="lineNum">     333 </span>                :        *  @return  A file position object.
<span class="lineNum">     334 </span>                :        *
<span class="lineNum">     335 </span>                :        *  If @c fail() is not false, returns @c pos_type(-1) to indicate
<span class="lineNum">     336 </span>                :        *  failure.  Otherwise returns @c rdbuf()-&gt;pubseekoff(0,cur,out).
<span class="lineNum">     337 </span>                :       */
<span class="lineNum">     338 </span>                :       pos_type 
<span class="lineNum">     339 </span>                :       tellp();
<span class="lineNum">     340 </span>                : 
<span class="lineNum">     341 </span>                :       /**
<span class="lineNum">     342 </span>                :        *  @brief  Changing the current write position.
<span class="lineNum">     343 </span>                :        *  @param  pos  A file position object.
<span class="lineNum">     344 </span>                :        *  @return  *this
<span class="lineNum">     345 </span>                :        *
<span class="lineNum">     346 </span>                :        *  If @c fail() is not true, calls @c rdbuf()-&gt;pubseekpos(pos).  If
<span class="lineNum">     347 </span>                :        *  that function fails, sets failbit.
<span class="lineNum">     348 </span>                :       */
<span class="lineNum">     349 </span>                :       __ostream_type&amp; 
<span class="lineNum">     350 </span>                :       seekp(pos_type);
<span class="lineNum">     351 </span>                : 
<span class="lineNum">     352 </span>                :       /**
<span class="lineNum">     353 </span>                :        *  @brief  Changing the current write position.
<span class="lineNum">     354 </span>                :        *  @param  off  A file offset object.
<span class="lineNum">     355 </span>                :        *  @param  dir  The direction in which to seek.
<span class="lineNum">     356 </span>                :        *  @return  *this
<span class="lineNum">     357 </span>                :        *
<span class="lineNum">     358 </span>                :        *  If @c fail() is not true, calls @c rdbuf()-&gt;pubseekoff(off,dir).
<span class="lineNum">     359 </span>                :        *  If that function fails, sets failbit.
<span class="lineNum">     360 </span>                :       */
<span class="lineNum">     361 </span>                :        __ostream_type&amp; 
<span class="lineNum">     362 </span>                :       seekp(off_type, ios_base::seekdir);
<span class="lineNum">     363 </span>                :       
<span class="lineNum">     364 </span>                :     protected:
<span class="lineNum">     365 </span><span class="lineNoCov">              0 :       basic_ostream()</span>
<span class="lineNum">     366 </span><span class="lineNoCov">              0 :       { this-&gt;init(0); }</span>
<span class="lineNum">     367 </span>                : 
<span class="lineNum">     368 </span>                :       template&lt;typename _ValueT&gt;
<span class="lineNum">     369 </span>                :         __ostream_type&amp;
<span class="lineNum">     370 </span>                :         _M_insert(_ValueT __v);
<span class="lineNum">     371 </span>                :     };
<span class="lineNum">     372 </span>                : 
<span class="lineNum">     373 </span>                :   /**
<span class="lineNum">     374 </span>                :    *  @brief  Performs setup work for output streams.
<span class="lineNum">     375 </span>                :    *
<span class="lineNum">     376 </span>                :    *  Objects of this class are created before all of the standard
<span class="lineNum">     377 </span>                :    *  inserters are run.  It is responsible for &quot;exception-safe prefix and
<span class="lineNum">     378 </span>                :    *  suffix operations.&quot;  Additional actions may be added by the
<span class="lineNum">     379 </span>                :    *  implementation, and we list them in
<span class="lineNum">     380 </span>                :    *  http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#5
<span class="lineNum">     381 </span>                :    *  under [27.6] notes.
<span class="lineNum">     382 </span>                :   */
<span class="lineNum">     383 </span>                :   template &lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     384 </span>                :     class basic_ostream&lt;_CharT, _Traits&gt;::sentry
<span class="lineNum">     385 </span>                :     {
<span class="lineNum">     386 </span>                :       // Data Members:
<span class="lineNum">     387 </span>                :       bool                              _M_ok;
<span class="lineNum">     388 </span>                :       basic_ostream&lt;_CharT, _Traits&gt;&amp;         _M_os;
<span class="lineNum">     389 </span>                :       
<span class="lineNum">     390 </span>                :     public:
<span class="lineNum">     391 </span>                :       /**
<span class="lineNum">     392 </span>                :        *  @brief  The constructor performs preparatory work.
<span class="lineNum">     393 </span>                :        *  @param  os  The output stream to guard.
<span class="lineNum">     394 </span>                :        *
<span class="lineNum">     395 </span>                :        *  If the stream state is good (@a os.good() is true), then if the
<span class="lineNum">     396 </span>                :        *  stream is tied to another output stream, @c is.tie()-&gt;flush()
<span class="lineNum">     397 </span>                :        *  is called to synchronize the output sequences.
<span class="lineNum">     398 </span>                :        *
<span class="lineNum">     399 </span>                :        *  If the stream state is still good, then the sentry state becomes
<span class="lineNum">     400 </span>                :        *  true (&quot;okay&quot;).
<span class="lineNum">     401 </span>                :       */
<span class="lineNum">     402 </span>                :       explicit
<span class="lineNum">     403 </span>                :       sentry(basic_ostream&lt;_CharT, _Traits&gt;&amp; __os);
<span class="lineNum">     404 </span>                : 
<span class="lineNum">     405 </span>                :       /**
<span class="lineNum">     406 </span>                :        *  @brief  Possibly flushes the stream.
<span class="lineNum">     407 </span>                :        *
<span class="lineNum">     408 </span>                :        *  If @c ios_base::unitbuf is set in @c os.flags(), and
<span class="lineNum">     409 </span>                :        *  @c std::uncaught_exception() is true, the sentry destructor calls
<span class="lineNum">     410 </span>                :        *  @c flush() on the output stream.
<span class="lineNum">     411 </span>                :       */
<span class="lineNum">     412 </span>                :       ~sentry()
<span class="lineNum">     413 </span>                :       {
<span class="lineNum">     414 </span>                :         // XXX MT
<span class="lineNum">     415 </span>                :         if (bool(_M_os.flags() &amp; ios_base::unitbuf) &amp;&amp; !uncaught_exception())
<span class="lineNum">     416 </span>                :           {
<span class="lineNum">     417 </span>                :             // Can't call flush directly or else will get into recursive lock.
<span class="lineNum">     418 </span>                :             if (_M_os.rdbuf() &amp;&amp; _M_os.rdbuf()-&gt;pubsync() == -1)
<span class="lineNum">     419 </span>                :               _M_os.setstate(ios_base::badbit);
<span class="lineNum">     420 </span>                :           }
<span class="lineNum">     421 </span>                :       }
<span class="lineNum">     422 </span>                : 
<span class="lineNum">     423 </span>                :       /**
<span class="lineNum">     424 </span>                :        *  @brief  Quick status checking.
<span class="lineNum">     425 </span>                :        *  @return  The sentry state.
<span class="lineNum">     426 </span>                :        *
<span class="lineNum">     427 </span>                :        *  For ease of use, sentries may be converted to booleans.  The
<span class="lineNum">     428 </span>                :        *  return value is that of the sentry state (true == okay).
<span class="lineNum">     429 </span>                :       */
<span class="lineNum">     430 </span>                :       operator bool() const
<span class="lineNum">     431 </span>                :       { return _M_ok; }
<span class="lineNum">     432 </span>                :     };
<span class="lineNum">     433 </span>                : 
<span class="lineNum">     434 </span>                :   // [27.6.2.5.4] character insertion templates
<span class="lineNum">     435 </span>                :   //@{
<span class="lineNum">     436 </span>                :   /**
<span class="lineNum">     437 </span>                :    *  @brief  Character inserters
<span class="lineNum">     438 </span>                :    *  @param  out  An output stream.
<span class="lineNum">     439 </span>                :    *  @param  c  A character.
<span class="lineNum">     440 </span>                :    *  @return  out
<span class="lineNum">     441 </span>                :    *
<span class="lineNum">     442 </span>                :    *  Behaves like one of the formatted arithmetic inserters described in
<span class="lineNum">     443 </span>                :    *  std::basic_ostream.  After constructing a sentry object with good
<span class="lineNum">     444 </span>                :    *  status, this function inserts a single character and any required
<span class="lineNum">     445 </span>                :    *  padding (as determined by [22.2.2.2.2]).  @c out.width(0) is then
<span class="lineNum">     446 </span>                :    *  called.
<span class="lineNum">     447 </span>                :    *
<span class="lineNum">     448 </span>                :    *  If @a c is of type @c char and the character type of the stream is not
<span class="lineNum">     449 </span>                :    *  @c char, the character is widened before insertion.
<span class="lineNum">     450 </span>                :   */
<span class="lineNum">     451 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     452 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">     453 </span>                :     operator&lt;&lt;(basic_ostream&lt;_CharT, _Traits&gt;&amp; __out, _CharT __c)
<span class="lineNum">     454 </span>                :     { return __ostream_insert(__out, &amp;__c, 1); }
<span class="lineNum">     455 </span>                : 
<span class="lineNum">     456 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     457 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">     458 </span>                :     operator&lt;&lt;(basic_ostream&lt;_CharT, _Traits&gt;&amp; __out, char __c)
<span class="lineNum">     459 </span>                :     { return (__out &lt;&lt; __out.widen(__c)); }
<span class="lineNum">     460 </span>                : 
<span class="lineNum">     461 </span>                :   // Specialization
<span class="lineNum">     462 </span>                :   template &lt;class _Traits&gt; 
<span class="lineNum">     463 </span>                :     inline basic_ostream&lt;char, _Traits&gt;&amp;
<span class="lineNum">     464 </span><span class="lineNoCov">              0 :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, char __c)</span>
<span class="lineNum">     465 </span><span class="lineNoCov">              0 :     { return __ostream_insert(__out, &amp;__c, 1); }</span>
<span class="lineNum">     466 </span>                : 
<span class="lineNum">     467 </span>                :   // Signed and unsigned
<span class="lineNum">     468 </span>                :   template&lt;class _Traits&gt;
<span class="lineNum">     469 </span>                :     inline basic_ostream&lt;char, _Traits&gt;&amp;
<span class="lineNum">     470 </span>                :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, signed char __c)
<span class="lineNum">     471 </span>                :     { return (__out &lt;&lt; static_cast&lt;char&gt;(__c)); }
<span class="lineNum">     472 </span>                :   
<span class="lineNum">     473 </span>                :   template&lt;class _Traits&gt;
<span class="lineNum">     474 </span>                :     inline basic_ostream&lt;char, _Traits&gt;&amp;
<span class="lineNum">     475 </span><span class="lineNoCov">              0 :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, unsigned char __c)</span>
<span class="lineNum">     476 </span><span class="lineNoCov">              0 :     { return (__out &lt;&lt; static_cast&lt;char&gt;(__c)); }</span>
<span class="lineNum">     477 </span>                :   //@}
<span class="lineNum">     478 </span>                :   
<span class="lineNum">     479 </span>                :   //@{
<span class="lineNum">     480 </span>                :   /**
<span class="lineNum">     481 </span>                :    *  @brief  String inserters
<span class="lineNum">     482 </span>                :    *  @param  out  An output stream.
<span class="lineNum">     483 </span>                :    *  @param  s  A character string.
<span class="lineNum">     484 </span>                :    *  @return  out
<span class="lineNum">     485 </span>                :    *  @pre  @a s must be a non-NULL pointer
<span class="lineNum">     486 </span>                :    *
<span class="lineNum">     487 </span>                :    *  Behaves like one of the formatted arithmetic inserters described in
<span class="lineNum">     488 </span>                :    *  std::basic_ostream.  After constructing a sentry object with good
<span class="lineNum">     489 </span>                :    *  status, this function inserts @c traits::length(s) characters starting
<span class="lineNum">     490 </span>                :    *  at @a s, widened if necessary, followed by any required padding (as
<span class="lineNum">     491 </span>                :    *  determined by [22.2.2.2.2]).  @c out.width(0) is then called.
<span class="lineNum">     492 </span>                :   */
<span class="lineNum">     493 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     494 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp;
<span class="lineNum">     495 </span>                :     operator&lt;&lt;(basic_ostream&lt;_CharT, _Traits&gt;&amp; __out, const _CharT* __s)
<span class="lineNum">     496 </span>                :     {
<span class="lineNum">     497 </span>                :       if (!__s)
<span class="lineNum">     498 </span>                :         __out.setstate(ios_base::badbit);
<span class="lineNum">     499 </span>                :       else
<span class="lineNum">     500 </span>                :         __ostream_insert(__out, __s,
<span class="lineNum">     501 </span>                :                          static_cast&lt;streamsize&gt;(_Traits::length(__s)));
<span class="lineNum">     502 </span>                :       return __out;
<span class="lineNum">     503 </span>                :     }
<span class="lineNum">     504 </span>                : 
<span class="lineNum">     505 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     506 </span>                :     basic_ostream&lt;_CharT, _Traits&gt; &amp;
<span class="lineNum">     507 </span>                :     operator&lt;&lt;(basic_ostream&lt;_CharT, _Traits&gt;&amp; __out, const char* __s);
<span class="lineNum">     508 </span>                : 
<span class="lineNum">     509 </span>                :   // Partial specializations
<span class="lineNum">     510 </span>                :   template&lt;class _Traits&gt;
<span class="lineNum">     511 </span>                :     inline basic_ostream&lt;char, _Traits&gt;&amp;
<span class="lineNum">     512 </span><span class="lineNoCov">              0 :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, const char* __s)</span>
<span class="lineNum">     513 </span>                :     {
<span class="lineNum">     514 </span><span class="lineNoCov">              0 :       if (!__s)</span>
<span class="lineNum">     515 </span><span class="lineNoCov">              0 :         __out.setstate(ios_base::badbit);</span>
<span class="lineNum">     516 </span>                :       else
<span class="lineNum">     517 </span><span class="lineNoCov">              0 :         __ostream_insert(__out, __s,</span>
<span class="lineNum">     518 </span>                :                          static_cast&lt;streamsize&gt;(_Traits::length(__s)));
<span class="lineNum">     519 </span><span class="lineNoCov">              0 :       return __out;</span>
<span class="lineNum">     520 </span>                :     }
<span class="lineNum">     521 </span>                : 
<span class="lineNum">     522 </span>                :   // Signed and unsigned
<span class="lineNum">     523 </span>                :   template&lt;class _Traits&gt;
<span class="lineNum">     524 </span>                :     inline basic_ostream&lt;char, _Traits&gt;&amp;
<span class="lineNum">     525 </span>                :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, const signed char* __s)
<span class="lineNum">     526 </span>                :     { return (__out &lt;&lt; reinterpret_cast&lt;const char*&gt;(__s)); }
<span class="lineNum">     527 </span>                : 
<span class="lineNum">     528 </span>                :   template&lt;class _Traits&gt;
<span class="lineNum">     529 </span>                :     inline basic_ostream&lt;char, _Traits&gt; &amp;
<span class="lineNum">     530 </span>                :     operator&lt;&lt;(basic_ostream&lt;char, _Traits&gt;&amp; __out, const unsigned char* __s)
<span class="lineNum">     531 </span>                :     { return (__out &lt;&lt; reinterpret_cast&lt;const char*&gt;(__s)); }
<span class="lineNum">     532 </span>                :   //@}
<span class="lineNum">     533 </span>                : 
<span class="lineNum">     534 </span>                :   // [27.6.2.7] standard basic_ostream manipulators
<span class="lineNum">     535 </span>                :   /**
<span class="lineNum">     536 </span>                :    *  @brief  Write a newline and flush the stream.
<span class="lineNum">     537 </span>                :    *
<span class="lineNum">     538 </span>                :    *  This manipulator is often mistakenly used when a simple newline is
<span class="lineNum">     539 </span>                :    *  desired, leading to poor buffering performance.  See
<span class="lineNum">     540 </span>                :    *  http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more
<span class="lineNum">     541 </span>                :    *  on this subject.
<span class="lineNum">     542 </span>                :   */
<span class="lineNum">     543 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     544 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp; 
<span class="lineNum">     545 </span><span class="lineNoCov">              0 :     endl(basic_ostream&lt;_CharT, _Traits&gt;&amp; __os)</span>
<span class="lineNum">     546 </span><span class="lineNoCov">              0 :     { return flush(__os.put(__os.widen('\n'))); }</span>
<span class="lineNum">     547 </span>                : 
<span class="lineNum">     548 </span>                :   /**
<span class="lineNum">     549 </span>                :    *  @brief  Write a null character into the output sequence.
<span class="lineNum">     550 </span>                :    *
<span class="lineNum">     551 </span>                :    *  &quot;Null character&quot; is @c CharT() by definition.  For CharT of @c char,
<span class="lineNum">     552 </span>                :    *  this correctly writes the ASCII @c NUL character string terminator.
<span class="lineNum">     553 </span>                :   */
<span class="lineNum">     554 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     555 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp; 
<span class="lineNum">     556 </span>                :     ends(basic_ostream&lt;_CharT, _Traits&gt;&amp; __os)
<span class="lineNum">     557 </span>                :     { return __os.put(_CharT()); }
<span class="lineNum">     558 </span>                :   
<span class="lineNum">     559 </span>                :   /**
<span class="lineNum">     560 </span>                :    *  @brief  Flushes the output stream.
<span class="lineNum">     561 </span>                :    *
<span class="lineNum">     562 </span>                :    *  This manipulator simply calls the stream's @c flush() member function.
<span class="lineNum">     563 </span>                :   */
<span class="lineNum">     564 </span>                :   template&lt;typename _CharT, typename _Traits&gt;
<span class="lineNum">     565 </span>                :     inline basic_ostream&lt;_CharT, _Traits&gt;&amp; 
<span class="lineNum">     566 </span><span class="lineNoCov">              0 :     flush(basic_ostream&lt;_CharT, _Traits&gt;&amp; __os)</span>
<span class="lineNum">     567 </span><span class="lineNoCov">              0 :     { return __os.flush(); }</span>
<span class="lineNum">     568 </span>                : 
<span class="lineNum">     569 </span>                : _GLIBCXX_END_NAMESPACE
<span class="lineNum">     570 </span>                : 
<span class="lineNum">     571 </span>                : #ifndef _GLIBCXX_EXPORT_TEMPLATE
<span class="lineNum">     572 </span>                : # include &lt;bits/ostream.tcc&gt;
<span class="lineNum">     573 </span>                : #endif
<span class="lineNum">     574 </span>                : 
<span class="lineNum">     575 </span>                : #endif  /* _GLIBCXX_OSTREAM */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
